﻿
using Service.src.NW.Model.Enum;
using System.Collections.Generic;

namespace Service.src.NW.Model.Folw.PLC
{

    /// <summary>
    /// PLC节点的输入参数
    /// </summary>
    public class NodePLCInputParam : NodeDataSource
    {

        /// <summary>
        /// 
        /// PLC的读节点输入参数
        /// 
        /// 如果 datasource 是 PLC 时使用，可以执行读多个地址
        /// 存放的plc的偏移量
        public List<NodeInputPlcReadParam> ReadParams { get; set; } = new List<NodeInputPlcReadParam>();

        /// <summary>
        /// PLC的写节点输入参数
        /// </summary>
        public List<NodeInputPlcWriteParam> WriteParams { get; set; }

        /// <summary>
        /// 判断是否符合结束条件，目前只用在读节点
        /// 
        /// 当前节点的结束运行条件
        /// 
        /// 当前对象如果为空，表示无需判断，直接结束当前节点，执行下一个节点
        /// </summary>
        public List<EndCondition> EndConditions { get; set; }

    }

    public class EndCondition
    {

        /// <summary>
        /// 运算符
        /// = 等于
        /// > 大于
        /// < 小于
        /// BETWEEN 区间
        /// NOT_BETWEEN 区间外
        /// CONTAINS 包含
        /// NOT_CONTAINS 不包含
        /// </summary>
        public OperatorEnum Operator;

        /// <summary>
        /// 比较的值
        /// </summary>
        public string Value1;
        /// <summary>
        /// 比较的值
        /// </summary>
        public string Value2;
    }
}
